package com.ruoyi.miniapp.service.impl;

import com.ruoyi.miniapp.domain.Malfunction;
import com.ruoyi.miniapp.mapper.MalfunctionMapper;
import com.ruoyi.miniapp.service.IMalfunctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 故障信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-23
 */
@Service
public class MalfunctionServiceImpl implements IMalfunctionService
{
    @Autowired
    private MalfunctionMapper malfunctionMapper;

    /**
     * 查询故障信息
     * 
     * @param malfunctionId 故障信息主键
     * @return 故障信息
     */
    @Override
    public Malfunction selectMalfunctionByMalfunctionId(Long malfunctionId)
    {
        return malfunctionMapper.selectMalfunctionByMalfunctionId(malfunctionId);
    }

    /**
     * 查询故障信息列表
     * 
     * @param malfunction 故障信息
     * @return 故障信息
     */
    @Override
    public List<Malfunction> selectMalfunctionList(Malfunction malfunction)
    {
        return malfunctionMapper.selectMalfunctionList(malfunction);
    }

    /**
     * 新增故障信息
     * 
     * @param malfunction 故障信息
     * @return 结果
     */
    @Override
    public int insertMalfunction(Malfunction malfunction)
    {
        return malfunctionMapper.insertMalfunction(malfunction);
    }

    /**
     * 修改故障信息
     * 
     * @param malfunction 故障信息
     * @return 结果
     */
    @Override
    public int updateMalfunction(Malfunction malfunction)
    {
        return malfunctionMapper.updateMalfunction(malfunction);
    }

    /**
     * 批量删除故障信息
     * 
     * @param malfunctionIds 需要删除的故障信息主键
     * @return 结果
     */
    @Override
    public int deleteMalfunctionByMalfunctionIds(Long[] malfunctionIds)
    {
        return malfunctionMapper.deleteMalfunctionByMalfunctionIds(malfunctionIds);
    }

    /**
     * 删除故障信息信息
     * 
     * @param malfunctionId 故障信息主键
     * @return 结果
     */
    @Override
    public int deleteMalfunctionByMalfunctionId(Long malfunctionId)
    {
        return malfunctionMapper.deleteMalfunctionByMalfunctionId(malfunctionId);
    }
}
